package fip.map.br;

	public class ForecastDisplay implements Observer, DisplayElement {
		private float currentPressure = 29.92f;  
		private float lastPressure;
		private WeatherData weatherData;
		
		public ForecastDisplay(WeatherData weatherData) {
			this.weatherData = weatherData;
			weatherData.registrerObserver(this);
		}

		public void update(float temp, float humidity, float pressure) {
	        lastPressure = currentPressure;
	        currentPressure = pressure;
			display();
		}

		public void display() {
			System.out.print("Forecast: ");
			if (currentPressure > lastPressure) {
				System.out.println("Improving weather on the way!");
			} else if (currentPressure == lastPressure) {
				System.out.println("More of thesame");
			} else if (currentPressure < lastPressure) {
				

			System.out.println("Watch out for cooler, rainy weather");
			}
		}
	}

